package teacher;
import java.sql.SQLException;


import basic.ClientConsole;

import com.sun.rowset.CachedRowSetImpl;

import flexibility.CachedRowSetTableModel;
import flexibility.userData;
import guiCode.PrevSemesterCode;

public class getassignment {
	String semname;
	String semyear;
	public CachedRowSetImpl getassignments(ClientConsole teacherConnection,
			CachedRowSetImpl rs, userData T_Data,Integer myID,String s1,String s3,String s4) {
		semyear=s4.substring(0, (s4.length())-1);
		semname=s4.substring(s4.length()-1);
		T_Data.deleteAll();
		T_Data.addData(23);
		T_Data.addData(1);
		T_Data.addData(semyear);
		T_Data.addData(semname);
		teacherConnection.acceptMsg(T_Data);
        CachedRowSetImpl r1 = teacherConnection.getResults();
        
		T_Data.deleteAll();
		T_Data.addData(22);
		T_Data.addData(1);
		T_Data.addData(myID);
		try {
			r1.next();
			T_Data.addData(r1.getString(1));
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}//semesterID
		T_Data.addData(s1);//courseID
		T_Data.addData(s3);//courseName
		
		teacherConnection.acceptMsg(T_Data);
        rs=teacherConnection.getResults();
		
        return rs;
		
	}

}
